package com.hvgroup.modules.sanic.domain.po;

import com.hvgroup.base.BaseEntity;
import com.hvgroup.modules.system.domain.User;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

@Entity
@Getter
@Setter
@Table(name = "conv_user_qa_record")
public class UserQaRecord extends BaseEntity implements Serializable {

    @Id
    @Column(name = "id")
    @NotNull(groups = Update.class)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @ApiModelProperty(value = "ID", hidden = true)
    private Long id;

    @OneToOne
    @JoinColumn(name = "user_id")
    @ApiModelProperty(value = "用户")
    private User user;

    @NotBlank
    @Column(unique = true)
    @ApiModelProperty(value = "diy/对话id")
    private String conversationId;

    @NotBlank
    @ApiModelProperty(value = "dify/消息id")
    private String messageId;

    @NotBlank
    @ApiModelProperty(value = "dify/任务id")
    private String taskId;

    @NotBlank
    @ApiModelProperty(value = "对话id")
    private String chatId;

    @NotBlank
    @ApiModelProperty(value = "用户问题")
    private String question;

    @NotBlank
    @ApiModelProperty(value = "大模型答案")
    @Column(name = "to2_answer")
    private String to2Answer;

    @NotBlank
    @ApiModelProperty(value = "业务数据")
    @Column(name = "to4_answer")
    private String to4Answer;

    @NotBlank
    @ApiModelProperty(value = "问答类型")
    private String qaType;

    @NotBlank
    @ApiModelProperty(value = "文件minio/key")
    private String fileKey;

}